package com.peter.demo.annotations.injections.qualifier;

import com.peter.project.dao.MyDao;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration
@ComponentScan({
        "com.peter.project.controller",
        "com.peter.project.service",
        "com.peter.project.dao"
})
public class MyConfig {
    @Bean("dao")
    public MyDao dao(){
        MyDao dao = new MyDao();
        dao.setFlag("2");
        return dao;
    }
}
